package mutsumimod.cards.deprecated;

import basemod.AutoAdd;
import com.megacrit.cardcrawl.actions.common.MakeTempCardInHandAction;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.monsters.AbstractMonster;
import mutsumimod.cards.BaseCard;
import mutsumimod.cards.copy.Imagination;
import mutsumimod.character.Mutsumi;
import mutsumimod.util.CardStats;
import mutsumimod.util.CardUtils;

@Deprecated
@AutoAdd.Ignore
public class WishYourDream extends BaseCard {
    public static final String ID = makeID(WishYourDream.class.getSimpleName());
    public static final CardStats info = new CardStats(
            Mutsumi.Meta.CARD_COLOR,
            CardType.SKILL,
            CardRarity.COMMON,
            CardTarget.SELF,
            1
    );

    public WishYourDream() {
        super(ID, info);
        setAttr(0,8,1);
        setAttrUpg(0,4,0);
        cardsToPreview = new Imagination(CardRarity.COMMON);
        standTag=5;
    }

    @Override
    public void use(AbstractPlayer p, AbstractMonster m) {
        gainBlock();
        stand(5,m);
    }

    @Override
    public void standUse5(AbstractPlayer p, AbstractMonster m) {
        addToTop(new MakeTempCardInHandAction(new Imagination(rarity)));
        if(upgraded) {
            addToTop(new MakeTempCardInHandAction(new Imagination(rarity)));
        }
    }

    @Override
    public void upgrade() {
        if(!upgraded) {
            super.upgrade();
            upgraded=!rarity.equals(AbstractCard.CardRarity.COMMON);
            rarity= CardUtils.getNextCardRarity(rarity);
            cardsToPreview = new Imagination(rarity);
            updateDescription();
        }
    }

    @Override
    public void updateDescription() {
        if(rarity.equals(AbstractCard.CardRarity.COMMON)) {
            rawDescription=cardStrings.DESCRIPTION+cardStrings.EXTENDED_DESCRIPTION[0];
        }else{
            rawDescription=cardStrings.DESCRIPTION;
        }
        initializeDescription();
    }

    @Override
    public AbstractCard makeCopy() {
        return new WishYourDream();
    }
}
